{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\lps29\Dropbox\Party_Interactions_Perceptions\PSRM Submission\Replication Files\fig A3_1.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}10 Apr 2023, 08:25:07

{com}. do "C:\Users\lps29\AppData\Local\Temp\STD04000000.tmp"
{txt}
{com}. 
. /* This do file provides the code to generate Figure A3.1 in Appendix 3. */
. 
. global dataDir "~/Dropbox/Party_Interactions_Perceptions/PSRM Submission/Replication Files"
{txt}
{com}. use "$dataDir/replication_data.dta", clear
{txt}
{com}. 
. 
. 
. set more off
{txt}
{com}. foreach i of numlist 1 2{c -(}
{txt}  2{com}. 
. replace dyad_name`i'="AfD" if dyad_name`i'=="afd"
{txt}  3{com}. replace dyad_name`i'="Alt" if dyad_name`i'=="alt"
{txt}  4{com}. replace dyad_name`i'="BQ" if dyad_name`i'=="bq"
{txt}  5{com}. replace dyad_name`i'="CDU" if dyad_name`i'=="cdu"
{txt}  6{com}. replace dyad_name`i'="Cons" if dyad_name`i'=="cons"
{txt}  7{com}. replace dyad_name`i'="KF" if dyad_name`i'=="cpp"
{txt}  8{com}. replace dyad_name`i'="DF" if dyad_name`i'=="dpp"
{txt}  9{com}. replace dyad_name`i'="Enh" if dyad_name`i'=="enh"
{txt} 10{com}. replace dyad_name`i'="FDP" if dyad_name`i'=="fdp"
{txt} 11{com}. replace dyad_name`i'="Lab" if dyad_name`i'=="lab"
{txt} 12{com}. replace dyad_name`i'="Lib" if dyad_name`i'=="lib"
{txt} 13{com}. replace dyad_name`i'="LibDem" if dyad_name`i'=="libdem"
{txt} 14{com}. replace dyad_name`i'="Linke" if dyad_name`i'=="linke"
{txt} 15{com}. replace dyad_name`i'="NDP" if dyad_name`i'=="ndp"
{txt} 16{com}. replace dyad_name`i'="NB" if dyad_name`i'=="new"
{txt} 17{com}. replace dyad_name`i'="RadVen" if dyad_name`i'=="rad"
{txt} 18{com}. replace dyad_name`i'="SDP" if dyad_name`i'=="sdp"
{txt} 19{com}. replace dyad_name`i'="SNP" if dyad_name`i'=="snp"
{txt} 20{com}. replace dyad_name`i'="SPD" if dyad_name`i'=="spd"
{txt} 21{com}. replace dyad_name`i'="SF" if dyad_name`i'=="spp"
{txt} 22{com}. replace dyad_name`i'="UKIP" if dyad_name`i'=="ukip"
{txt} 23{com}. replace dyad_name`i'="Ven" if dyad_name`i'=="ven"
{txt} 24{com}. replace dyad_name`i'="Green" if dyad_name`i'=="green"
{txt} 25{com}. 
. 
. {c )-}
{txt}(6,128 real changes made)
(2,556 real changes made)
(2,352 real changes made)
(15,320 real changes made)
(17,643 real changes made)
(3,834 real changes made)
(8,946 real changes made)
(5,112 real changes made)
(9,192 real changes made)
(9,592 real changes made)
(4,704 real changes made)
(4,388 real changes made)
(3,064 real changes made)
(9,408 real changes made)
(1,278 real changes made)
(7,668 real changes made)
(11,502 real changes made)
(1,990 real changes made)
(12,256 real changes made)
(6,390 real changes made)
(995 real changes made)
(10,224 real changes made)
(0 real changes made)
(9,192 real changes made)
(8,946 real changes made)
(7,056 real changes made)
(0 real changes made)
(2,352 real changes made)
(7,668 real changes made)
(2,556 real changes made)
(6,390 real changes made)
(6,128 real changes made)
(2,398 real changes made)
(16,206 real changes made)
(4,796 real changes made)
(12,256 real changes made)
(0 real changes made)
(10,224 real changes made)
(3,834 real changes made)
(0 real changes made)
(7,194 real changes made)
(3,064 real changes made)
(5,112 real changes made)
(6,786 real changes made)
(1,278 real changes made)
(31,106 real changes made)

{com}. 
. capture drop dyadname
{txt}
{com}. egen dyadname=concat(dyad_name1 dyad_name2), punct("-")
{txt}
{com}. 
. 
. capture drop countryyear
{txt}
{com}. egen countryyear=concat(country year)
{txt}
{com}. 
. 
.  /* Canada 2017 */
.  
.  set more off
{txt}
{com}. 
. local figure=1
{txt}
{com}. levelsof dyadname if countryyear=="Canada2017" & coop!=., local(levels) 
{txt}`"BQ-Green"' `"Cons-BQ"' `"Cons-Green"' `"Cons-Lib"' `"Lib-BQ"' `"Lib-Green"' `"NDP-BQ"' `"NDP-Cons"' `"NDP-Green"' `"NDP-Lib"'

{com}.  foreach l of local levels {c -(}
{txt}  2{com}.  
. sum coop if dyadname=="`l'" & countryyear=="Canada2017" & coop!=.
{txt}  3{com}. 
. local ll2 : di %3.2f r(mean)
{txt}  4{com}. 
.  
. twoway histogram coop if dyadname=="`l'" & countryyear=="Canada2017" ///
>  & coop!=., ///
>  discrete percent xtitle("") ytitle("") color(gray) xline(`ll2') ///
>  text(27 `ll2' "`ll2'") title("`l'") graphregion(margin(0 0 0 0)) plotregion(margin(0 0 0 0)) ///
>  name(`ctryyear'fig`figure', replace) yscale(r(0 30)) nodraw
{txt}  5{com}.  
.  local figure=`figure'+1
{txt}  6{com}.  
.  {c )-}

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    3.472983    2.301169          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,350     3.90963     2.31906          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    3.928942    2.326526          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    3.906736    2.492396          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351     4.30866    2.337185          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    5.062916    2.245927          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,352    3.829882    2.198659          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    4.219097    2.272728          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    5.394523    2.170632          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,348    5.141691    2.112981          0         10
{txt}
{com}.  
.  
.  
.  capture drop partiesname
{txt}
{com}.  gen partiesname=""
{txt}(154,542 missing values generated)

{com}.  
.   capture drop avg
{txt}
{com}.  gen avg=.
{txt}(154,542 missing values generated)

{com}.  
.  local row=1
{txt}
{com}.  levelsof dyadname if countryyear=="Canada2017", local(levels) 
{txt}`"BQ-Green"' `"Cons-BQ"' `"Cons-Green"' `"Cons-Lib"' `"Lib-BQ"' `"Lib-Green"' `"NDP-BQ"' `"NDP-Cons"' `"NDP-Green"' `"NDP-Lib"'

{com}.  foreach l of local levels {c -(}
{txt}  2{com}.  sum coop if dyadname=="`l'" & countryyear=="Canada2017" & coop!=.
{txt}  3{com}. replace avg=r(mean) in `row'
{txt}  4{com}.   replace partiesname="`l'" in `row'
{txt}  5{com}.   local row=`row'+1
{txt}  6{com}. 
.  {c )-}

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    3.472983    2.301169          0         10
{txt}(1 real change made)
variable {bf}partiesname{sf} was {bf}{res}str1{sf}{txt} now {bf}{res}str8{sf}
{txt}(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,350     3.90963     2.31906          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    3.928942    2.326526          0         10
{txt}(1 real change made)
variable {bf}partiesname{sf} was {bf}{res}str8{sf}{txt} now {bf}{res}str10{sf}
{txt}(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    3.906736    2.492396          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351     4.30866    2.337185          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    5.062916    2.245927          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,352    3.829882    2.198659          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    4.219097    2.272728          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,351    5.394523    2.170632          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,348    5.141691    2.112981          0         10
{txt}(1 real change made)
(1 real change made)

{com}.  capture drop groupid
{txt}
{com}.  egen groupid=group(partiesname)
{txt}(154532 missing values generated)

{com}.  
.  
. graph combine fig9 fig10 fig6 fig5 fig8 fig3 fig2 fig4 fig7 ///
> fig1 , ///
>  l1(% of Respondents) b1(Perceived Cooperation Scores) rows(2) ///
>  note("Dashed line indicates the average cooperation score",size(vsmall)) ///
>  ycommon scale(1.15) title(Canada 2017)  
{res}{txt}
{com}.  
. 
.  
.  /* Canada 2019 */
.  
.  set more off
{txt}
{com}. 
. local figure=1
{txt}
{com}. levelsof dyadname if countryyear=="Canada2019" & coop!=., local(levels) 
{txt}`"BQ-Green"' `"Cons-BQ"' `"Cons-Green"' `"Cons-Lib"' `"Lib-BQ"' `"Lib-Green"' `"NDP-BQ"' `"NDP-Cons"' `"NDP-Green"' `"NDP-Lib"'

{com}.  foreach l of local levels {c -(}
{txt}  2{com}.  
. sum coop if dyadname=="`l'" & countryyear=="Canada2019" & coop!=.
{txt}  3{com}. 
. local ll2 : di %3.2f r(mean)
{txt}  4{com}. 
.  
. twoway histogram coop if dyadname=="`l'" & countryyear=="Canada2019" ///
>  & coop!=., ///
>  discrete percent xtitle("") ytitle("") color(gray) xline(`ll2') ///
>  text(27 `ll2' "`ll2'") title("`l'") graphregion(margin(0 0 0 0)) plotregion(margin(0 0 0 0)) ///
>  name(`ctryyear'fig`figure', replace) yscale(r(0 30)) nodraw
{txt}  5{com}.  
.  local figure=`figure'+1
{txt}  6{com}.  
.  {c )-}

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.523    2.144778          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.056    2.246756          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.545    2.206546          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       2.964    2.295642          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.356    2.227605          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.738    2.097082          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.732    2.062627          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.683    2.210746          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000        5.25    2.144784          0         10

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.736    2.150099          0         10
{txt}
{com}.  
.  
.  
.  capture drop partiesname
{txt}
{com}.  gen partiesname=""
{txt}(154,542 missing values generated)

{com}.  
.   capture drop avg
{txt}
{com}.  gen avg=.
{txt}(154,542 missing values generated)

{com}.  
.  local row=1
{txt}
{com}.  levelsof dyadname if countryyear=="Canada2019", local(levels) 
{txt}`"BQ-Green"' `"Cons-BQ"' `"Cons-Green"' `"Cons-Lib"' `"Lib-BQ"' `"Lib-Green"' `"NDP-BQ"' `"NDP-Cons"' `"NDP-Green"' `"NDP-Lib"'

{com}.  foreach l of local levels {c -(}
{txt}  2{com}.  sum coop if dyadname=="`l'" & countryyear=="Canada2019" & coop!=.
{txt}  3{com}. replace avg=r(mean) in `row'
{txt}  4{com}.   replace partiesname="`l'" in `row'
{txt}  5{com}.   local row=`row'+1
{txt}  6{com}. 
.  {c )-}

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.523    2.144778          0         10
{txt}(1 real change made)
variable {bf}partiesname{sf} was {bf}{res}str1{sf}{txt} now {bf}{res}str8{sf}
{txt}(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.056    2.246756          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.545    2.206546          0         10
{txt}(1 real change made)
variable {bf}partiesname{sf} was {bf}{res}str8{sf}{txt} now {bf}{res}str10{sf}
{txt}(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       2.964    2.295642          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.356    2.227605          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.738    2.097082          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.732    2.062627          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       3.683    2.210746          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000        5.25    2.144784          0         10
{txt}(1 real change made)
(1 real change made)

    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 8}coop {c |}{res}      1,000       4.736    2.150099          0         10
{txt}(1 real change made)
(1 real change made)

{com}.  capture drop groupid
{txt}
{com}.  egen groupid=group(partiesname)
{txt}(154532 missing values generated)

{com}.  
. graph combine fig9 fig6 fig10 fig5 fig2 fig7 fig8 fig3 fig1 ///
> fig4 , ///
>  l1(% of Respondents) b1(Perceived Cooperation Scores) rows(2) ///
>  note("Dashed line indicates the average cooperation score",size(vsmall)) ///
>  ycommon scale(1.15) title(Canada 2019) 
{res}{txt}
{com}.  
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\lps29\Dropbox\Party_Interactions_Perceptions\PSRM Submission\Replication Files\fig A3_1.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}10 Apr 2023, 08:26:57
{txt}{.-}
{smcl}
{txt}{sf}{ul off}